home *** CD-ROM | disk | FTP | other *** search
Wrap
bbbblllleeeennnnddddffffuuuunnnnccccttttiiiioooonnnn((((3333GGGG)))) bbbblllleeeennnnddddffffuuuunnnnccccttttiiiioooonnnn((((3333GGGG)))) NNNNAAAAMMMMEEEE bbbblllleeeennnnddddffffuuuunnnnccccttttiiiioooonnnn - computes a blended color value for a pixel CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN vvvvooooiiiidddd bbbblllleeeennnnddddffffuuuunnnnccccttttiiiioooonnnn((((lllloooonnnngggg ssssffffaaaaccccttttrrrr,,,, lllloooonnnngggg ddddffffaaaaccccttttrrrr)))) PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS _s_f_a_c_t_r is a symbolic constant taken from the list below. It identifies the blending factor by which to scale contribution from source pixel RGBA (red, green, blue, alpha) values. BBBBFFFF____ZZZZEEEERRRROOOO 0 BBBBFFFF____OOOONNNNEEEE 1 BBBBFFFF____DDDDCCCC (destination RGBA)/255 BBBBFFFF____MMMMDDDDCCCC 1 - (destination RGBA)/255 BBBBFFFF____SSSSAAAA (source alpha)/255 BBBBFFFF____MMMMSSSSAAAA 1 - (source alpha)/255 BBBBFFFF____DDDDAAAA (destination alpha)/255 BBBBFFFF____MMMMDDDDAAAA 1 - (destination alpha)/255 BBBBFFFF____MMMMIIIINNNN____SSSSAAAA____MMMMDDDDAAAA _m_i_n(BBBBFFFF____SSSSAAAA,,,, BBBBFFFF____MMMMDDDDAAAA) BBBBFFFF____CCCCCCCC (constant RGBA)/255 BBBBFFFF____MMMMCCCCCCCC 1 - (constant RGBA)/255 BBBBFFFF____CCCCAAAA (constant alpha)/255 BBBBFFFF____MMMMCCCCAAAA 1 - (constant alpha)/255 BBBBFFFF____MMMMIIIINNNN _m_i_n(1, destination RGBA/source RGBA) BBBBFFFF____MMMMAAAAXXXX _m_a_x(1, destination RGBA/source RGBA) _d_f_a_c_t_r is a symbolic constant taken from the list below. It identifies the blending factor by which to scale contribution from destination pixel RGBA values. BBBBFFFF____ZZZZEEEERRRROOOO 0 BBBBFFFF____OOOONNNNEEEE 1 BBBBFFFF____SSSSCCCC (source RGBA)/255 BBBBFFFF____MMMMSSSSCCCC 1 - (source RGBA)/255 BBBBFFFF____SSSSAAAA (source alpha)/255 BBBBFFFF____MMMMSSSSAAAA 1 - (source alpha)/255 BBBBFFFF____DDDDAAAA (destination alpha)/255 BBBBFFFF____MMMMDDDDAAAA 1 - (destination alpha)/255 BBBBFFFF____CCCCCCCC (constant RGBA)/255 BBBBFFFF____MMMMCCCCCCCC 1 - (constant RGBA)/255 BBBBFFFF____CCCCAAAA (constant alpha)/255 BBBBFFFF____MMMMCCCCAAAA 1 - (constant alpha)/255 A blending factor is obtained by evaluating a mathematical expression over a source RGBA value, a destination RGBA value and a constant RGBA value. The latter is provided with bbbblllleeeennnnddddccccoooolllloooorrrr. Blending factors, except for BBBBFFFF____MMMMIIIINNNN and BBBBFFFF____MMMMAAAAXXXX, use RGBA values converted to fractions of the maximum value 255. To improve performance, these conversion calculations are approximate. However, 0 converts exactly to 0.0, and 255 converts exactly to 1.0. PPPPaaaaggggeeee 1111 bbbblllleeeennnnddddffffuuuunnnnccccttttiiiioooonnnn((((3333GGGG)))) bbbblllleeeennnnddddffffuuuunnnnccccttttiiiioooonnnn((((3333GGGG)))) DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN In RGB mode, the system draws pixels using a function that blends the incoming (source) RGBA values with the RGBA values that are already in the framebuffer (the destination values). Most often, blending is simple: the source RGBA values replace the destination RGBA values of the pixel. In some cases, however, simple replacement of framebuffer values is not appropriate. Two such cases are transparency and antialiasing. To be blended properly, transparent objects must be rendered back-to-front (i.e. drawn in order from the farthest object to the nearest object) with a blend function of ((((BBBBFFFF____SSSSAAAA,,,, BBBBFFFF____MMMMSSSSAAAA)))). As can be seen from the equations below, this function scales the incoming color components by the incoming alpha value, and scales the framebuffer contents by one minus the incoming alpha value. Thus incoming (source) alpha is correctly thought of as a material opacity, ranging from 1.0 (completely opaque) to 0.0 (completely transparent). Note that this transparency calculation does not require the presence of alpha bitplanes in the framebuffer. Suggestions for appropriate blend functions for antialiasing are given on the ppppnnnnttttssssmmmmooooooootttthhhh and lllliiiinnnneeeessssmmmmooooooootttthhhh manual pages. Other less obvious applications are also possible. For example, if the red component in the framebuffer is first cleared to all zeros, and then each primitive is drawn with red set to 1 and a blend function of ((((BBBBFFFF____OOOONNNNEEEE,,,, BBBBFFFF____OOOONNNNEEEE)))), the red component of each pixel in the framebuffer will contain the count of the number of times that pixel was drawn. To determine the blended RGBA values of a pixel when drawing in RGB mode, the system uses the following functions: Rdestination = _m_i_n (255, ((Rsource * _s_f_a_c_t_r) + (Rdestination * _d_f_a_c_t_r))) Gdestination = _m_i_n (255, ((Gsource * _s_f_a_c_t_r) + (Gdestination * _d_f_a_c_t_r))) Bdestination = _m_i_n (255, ((Bsource * _s_f_a_c_t_r) + (Bdestination * _d_f_a_c_t_r))) Adestination = _m_i_n (255, ((Asource * _s_f_a_c_t_r) + (Adestination * _d_f_a_c_t_r))) When the blend function is set to ((((BBBBFFFF____OOOONNNNEEEE,,,, BBBBFFFF____ZZZZEEEERRRROOOO)))), the default values, the equations reduce to simple replacement: Rdestination = Rsource Gdestination = Gsource Bdestination = Bsource PPPPaaaaggggeeee 2222 bbbblllleeeennnnddddffffuuuunnnnccccttttiiiioooonnnn((((3333GGGG)))) bbbblllleeeennnnddddffffuuuunnnnccccttttiiiioooonnnn((((3333GGGG)))) Adestination = Asource Fill rate may be increased substantially when blending is disabled in this manner. Polygon antialiasing (see ppppoooollllyyyyssssmmmmooooooootttthhhh) is sometimes optimized when the blendfunction (BBBBFFFF____MMMMIIIINNNN____SSSSAAAA____MMMMDDDDAAAA,,,, BBBBFFFF____OOOONNNNEEEE)))) is used. Source factor BBBBFFFF____MMMMIIIINNNN____SSSSAAAA____MMMMDDDDAAAA, which should be used only with destination factor BBBBFFFF____OOOONNNNEEEE, has the side effect of slightly modifying the blending arithmetic: Rdestination = _m_i_n (255, ((Rsource * _s_f_a_c_t_r) + Rdestination)) Gdestination = _m_i_n (255, ((Gsource * _s_f_a_c_t_r) + Gdestination)) Bdestination = _m_i_n (255, ((Bsource * _s_f_a_c_t_r) + Bdestination)) Adestination = _s_f_a_c_t_r + Adestination This special blend function accumulates pixel contributions until the pixel is fully specified, then allows no further changes. Destination alpha bitplanes, which must be present for this blend function to operate correctly, store the accumulated coverage. In order to store the smallest or the largest RGBA value among the source RGBA and destination RGBA, simply use blendfunction(BF_MIN, BF_ZERO); or blendfunction(BF_MAX, BF_ZERO); respectively. Blending is available with or without z-buffer mode. When blendfunction is set to any value other than ((((BBBBFFFF____OOOONNNNEEEE,,,, BBBBFFFF____ZZZZEEEERRRROOOO)))), logicop is forced to LLLLOOOO____SSSSRRRRCCCC. SSSSEEEEEEEE AAAALLLLSSSSOOOO cpack, linesmooth, logicop, pntsmooth, polysmooth, blendcolor NNNNOOOOTTTTEEEESSSS Blending factors BBBBFFFF____DDDDAAAA, BBBBFFFF____MMMMDDDDAAAA, and BBBBFFFF____MMMMIIIINNNN____SSSSAAAA____MMMMDDDDAAAA are not supported on machines without alpha bitplanes. PPPPaaaaggggeeee 3333 bbbblllleeeennnnddddffffuuuunnnnccccttttiiiioooonnnn((((3333GGGG)))) bbbblllleeeennnnddddffffuuuunnnnccccttttiiiioooonnnn((((3333GGGG)))) IRIS-4D G, GT, and GTX models, the Personal Iris, Indigo Entry, XS, XS24, XZ, Elan and Extreme systems do not support blend factor BBBBFFFF____MMMMIIIINNNN____SSSSAAAA____MMMMDDDDAAAA. IRIS-4D G, GT, GTX, VGX, and VGXT models, the Personal Iris, Indigo Entry, Indy, XL, XS, XS24, and Elan systems do not support blend factors BBBBFFFF____CCCCCCCC, BBBBFFFF____MMMMCCCCCCCC, BBBBFFFF____CCCCAAAA, BBBBFFFF____MMMMCCCCAAAA, BBBBFFFF____MMMMIIIINNNN and BBBBFFFF____MMMMAAAAXXXX. IRIS-4D B and G models and the Personal Iris do not support this function at all. Use ggggeeeettttggggddddeeeesssscccc((((GGGGDDDD____BBBBLLLLEEEENNNNDDDD)))) to determine whether blending hardware is available. BBBBUUUUGGGGSSSS Blending works properly only in RGB mode. In color map mode, the results are unpredictable. On IRIS-4D G, GT, GTX, VGX, and VGXT models, the Personal Iris, Indigo Entry, Indy, XL, XS, XS24, and Elan systems when multiple destination buffers are specified (using ffffrrrroooonnnnttttbbbbuuuuffffffffeeeerrrr,,,, bbbbaaaacccckkkkbbbbuuuuffffffffeeeerrrr,,,, and zzzzddddrrrraaaawwww ) only a single location can be read and used as the _d_e_s_t_i_n_a_t_i_o_n value on the right side of the above equations. As a result, the _d_e_s_t_i_n_a_t_i_o_n values on the left and the right of the equations may not be taken from the same framebuffer locations. By default, the destination RGBA values are read from the front buffer in single buffer mode and from the back buffer in double buffer mode. If the front buffer is not enabled in single buffer mode, the RGBA values are taken from the z-buffer. If the back buffer is not enabled in double buffer mode, the RGBA values are taken from the front buffer (if possible) or from the z-buffer. On some IRIS-4D GT and GTX models, while copying rectangles with blending active, rrrreeeeaaaaddddssssoooouuuurrrrcccceeee also specifies the bank from which _d_e_s_t_i_n_a_t_i_o_n color and alpha are read (overriding the bbbblllleeeennnnddddffffuuuunnnnccccttttiiiioooonnnn setting). IRIS-4D VGX models do not clamp color values generated by the special blending function BBBBFFFF____MMMMIIIINNNN____SSSSAAAA____MMMMDDDDAAAA,,,,BBBBFFFF____OOOONNNNEEEE to 255. Instead, color values are allowed to wrap. PPPPaaaaggggeeee 4444